package com.htd.htdapmservice.mybatis;

import com.htd.htdapmcommon.mybatis.DalBaseMyBatis;
import com.htd.htdapmdmo.OneAlertKey;
import com.htd.htdapmservice.dao.OneAlertKeyDao;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class OneAlertKeyMapper extends DalBaseMyBatis<OneAlertKey> implements OneAlertKeyDao {

    @Override
    public int addOneAlertKey(OneAlertKey oneAlertKey) {
        return this.sqlSessionTemplate.insert(this.getEntityName() + ".insert", oneAlertKey);
    }

    @Override
    public int delOneAlertKeyByProductCode(String productCode) {
        return this.sqlSessionTemplate.delete(this.getEntityName() + ".deleteByProductCode", productCode);
    }

    @Override
    public int updataOneAlertKeyByProductCode(Map<String,Object> map) {
        return this.sqlSessionTemplate.update(this.getEntityName() + ".updateByProductCode", map);
    }

    @Override
    public OneAlertKey findOneAlertKeyByProductCode(String productCode) {
        return this.sqlSessionTemplate.selectOne(this.getEntityName() + ".findOneAlertKeyByProductCode", productCode);
    }
    @Override
    public List<OneAlertKey> findOneAlertKeyList(){
        return this.sqlSessionTemplate.selectList(this.getEntityName() + ".queryData");
    }

}